package com.code.day21;

import java.io.PrintStream;

public class Demo02PrintStream {
    public static void main(String[] args) throws Exception {
        PrintStream ps = new PrintStream("D:\\java-code\\java-full-stack\\01-java-base\\src\\com\\code\\day21\\file\\demo2.txt");

        System.out.println("有一个空指针异常:NullPointerException");

        //改变流向
        System.setOut(ps);

        System.out.println("有一个索引越界异常:IndexOutOfBoundsException");

    }
}
